<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Administrator
 * Date: 25/05/11
 * Time: 15:01
 * To change this template use File | Settings | File Templates.
 */

define("CONTROLLER", 1);
define("MODEL", 2);
define("VIEW", 3);
define("APPLICATION", 4);
define("INC", 5);
define("MISC", 6);
define("SITE_PREFIX",'/frame/');
define("ITEM",7);

$configuration['init']['service']['app_name'] = "Servicedesk De Hondsrug";
$configuration['init']['service']['stylesheet'] = "http://localhost/frame/html/css/style.css";
$configuration['init']['service']['title'] = "Servicedesk De Hondsrug";
class Config
{

    public static function controller_exists($controllerName)
    {
         return file_exists(self::acquire($controllerName,CONTROLLER));
    }

    public static function acquire($var, $type, $folder = '')
    {
        switch ($type) {
            case CONTROLLER;
                return "./sds/controller/impl/" . $var . "Controller.class.php";
            case MODEL:
                return "./sds/model/impl/" . $var . ".class.php";
            case VIEW :
                return "./sds/view/impl/" . $var . "View.class.php";
            case APPLICATION:
                return "./sds/application/" . $var . ".class.php";
            case INC:
                return "./sds/includes/" . $var . "inc.php";
            case ITEM:
                return "./sds/item/impl/".$var.".class.php";
            default:
                return "./sds/" . $folder . "/" . $var . '.class.php';
        }


    }

    public static function get($key,$subkey =''){
        global $configuration;
           return $configuration[$key][$subkey];
    }

}
